package cn.sheep.dmp.tools

import cn.sheep.dmp.utils.Tools
import org.apache.commons.pool2.impl.GenericObjectPoolConfig
import redis.clients.jedis.{Jedis, JedisPool}

/**
  * Sheep.Old @ 64341393
  * Created 2018/3/29
  */
object JPools {


    private val objectPoolConfig = new GenericObjectPoolConfig()
    objectPoolConfig.setMaxTotal(1000)

    private val jedisPool = new JedisPool(objectPoolConfig, Tools.load.getString("db.redis"))

    def getJedis: Jedis = jedisPool.getResource

}
